home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / vm / lock.h < prev    next >
C/C++ Source or Header  |  1990-09-12  |  959b  |  43 lines

  1. /*
  2.  * lock.h --
  3.  *
  4.  *    Header file to be used by files whose routines use the global vm
  5.  *    monitor.
  6.  *
  7.  * Copyright (C) 1985 Regents of the University of California
  8.  * All rights reserved.
  9.  *
  10.  *
  11.  * $Header: /sprite/src/kernel/vm/RCS/lock.h,v 9.2 90/09/12 13:36:47 shirriff Exp $ SPRITE (Berkeley)
  12.  */
  13.  
  14. #ifndef _VMLOCK
  15. #define _VMLOCK
  16.  
  17. #include <sync.h>
  18. #include <dbg.h>
  19.  
  20. /*
  21.  * Monitor declarations
  22.  */
  23.  
  24. extern    Sync_Lock vmMonitorLock;
  25. #define LOCKPTR &vmMonitorLock
  26.  
  27. #define Dbg_Call    printf("SHM MONITOR PROBLEM\n")
  28.  
  29. extern Sync_Lock vmShmLock;
  30. extern int vmShmLockCnt;
  31.  
  32. #if 0
  33. #define LOCK_SHM_MONITOR    if (vmShmLockCnt>0) {Dbg_Call;} else {Sync_GetLock(&vmShmLock); vmShmLockCnt++;}
  34. #define UNLOCK_SHM_MONITOR    if (vmShmLockCnt==0) {Dbg_Call;} else {Sync_Unlock(&vmShmLock); vmShmLockCnt--;}
  35. #define CHECK_SHM_MONITOR    if (vmShmLockCnt!=1) Dbg_Call
  36. #else
  37. #define LOCK_SHM_MONITOR
  38. #define UNLOCK_SHM_MONITOR
  39. #define CHECK_SHM_MONITOR
  40. #endif
  41.  
  42. #endif /* _VMLOCK */
  43.